<div id="repair-manage-view">
  <div class="page">
    <div class="al-list-container">
      <form class="form-horizontal al-search-container" role="form">
        <div class="form-group">
          <label class="col-sm-1 control-label">公寓</label>
          <div class="col-sm-3" ng-if="apartmentList.length>1">
            <qgy-apartment-item apm-data="search" apm-list="apartmentList"></qgy-apartment-item>
          </div>
          <label class="col-sm-2 control-label">报修日期</label>
          <div class="col-sm-2">
            <div class="input-group">
              <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd"
                     ng-model="search.startTime" is-open="enterStart" maxlength="10"
                     close-text="关闭" current-text="今天" clear-text="清空"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="enterStart=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
            </div>
          </div>
          <label class="control-label text-center al-fl-lt">&nbsp;&nbsp;~&nbsp;&nbsp;</label>
          <div class="col-sm-2">
            <div class="input-group">
              <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd"
                     ng-model="search.endTime" is-open="enterEnd" maxlength="10"
                     close-text="关闭" current-text="今天" clear-text="清空"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="enterEnd=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-1 control-label">状态</label>
          <div class="col-sm-3">
              <label class="ui-radio">
                <input name="status" ng-value="1" type="checkbox" ng-model="search.status_1" ng-checked="isSelected(1)" ng-click="updateSelection($event,1)">
                <span>待处理</span>
              </label>
              <label class="ui-radio">
                <input name="status" ng-value="2" type="checkbox" ng-model="search.status_2"  ng-checked="isSelected(2)" ng-click="updateSelection($event,2)">
                <span>待维修</span>
              </label>
              <label class="ui-radio">
                <input name="status" ng-value="4" type="checkbox" ng-model="search.status_4" ng-checked="isSelected(4)" ng-click="updateSelection($event,4)">
                <span>待评价</span>
              </label>
              <label class="ui-radio">
                <input name="status" ng-value="8" type="checkbox" ng-model="search.status_8"  ng-checked="isSelected(8)" ng-click="updateSelection($event,8)">
                <span>已评价</span>
              </label>
          </div>
          <div class="col-sm-1"></div>
          <div class="col-sm-3">
            <input class="form-control" type="text" placeholder="报修人，手机号"
                   ng-model="search.filter" maxlength="32">
          </div>
          <div class="col-sm-1 ">
            <button type="button" ng-click="queryData()" class="btn btn-success al-float-right">查询</button>
          </div>
          <div class="col-sm-1">
            <button type="button" ng-click="resetSearch()" class="btn btn-default">重置</button>
          </div>
        </div>
      </form>
      <table ng-table="tableParams"
             class="table  table-bordered table-striped table-condensed al-table-container">
        <thead>
        <tr>
          <td>序号</td>
          <td>报修人</td>
          <td>手机号</td>
          <td>公寓</td>
          <td>房间号</td>
          <td>报修时间</td>
          <td>报修内容</td>
          <td>客户评分</td>
          <td>客户评价</td>
          <td>上门日期</td>
          <td>状态</td>
          <td>操作</td>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="item in $data">
          <td>{{$index+1}}</td>
          <td>{{item.name}}</td>
          <td>{{item.phone}}</td>
          <td>{{item.productName}}</td>
          <td>{{item.itemName}}</td>
          <td>{{item.createTime|dateTransfer:'YYYY-MM-DD HH:mm'}}</td>
          <td>{{item.content}}</td>
          <td>{{item.commentScore}}</td>
          <td>{{item.comment}}</td>
          <td>{{item.providerTime|dateTransfer:'YYYY-MM-DD HH:mm'}}</td>
          <td>{{item.statusName}}</td>
          <td>
            <button class="btn btn-info btn-sm" ng-click="dealData(item)" ng-if="item.status < 4">处理</button>
            <button class="btn btn-success btn-sm" ng-click="viewData(item)">详情</button>
            <button class="btn btn-primary btn-sm" ng-click="printData(item)">打印</button>
          </td>
        </tr>
        </tbody>
      </table>
    </div>
  </div>
  <div style="display: none">
    <div id="repair-print-container" ng-if="printItem">
<style type="text/css">
  #repair-print-container h4 {
    margin: 20% 0 32px;
  }
  #repair-print-container .print-table {
    border-collapse:collapse;
    position: relative;
    width: 530px;
    margin: 0 auto;
  }

  #repair-print-container .print-table tr {
    min-height: 40px;
    font-size: 15px;
    vertical-align: middle;
  }
  #repair-print-container .print-table td {
    padding:10px 10px;
  }
</style>
      <h4 class="text-center" style="margin:20% 0 32px;">报修单</h4>
      <div class="table-container">
        <table class="print-table table-bordered" style="width: 450px;margin: 0 auto;font-size: 15px;">
          <tr>
            <td width="100">单号</td>
            <td colspan="3">{{printItem.uuid}}</td>
          </tr>
          <tr>
            <td width="100">报修人</td>
            <td width="160">{{printItem.name}}</td>
            <td width="100">手机</td>
            <td width="160">{{printItem.phone}}</td>
          </tr>
          <tr>
            <td width="100">公寓</td>
            <td width="160">{{printItem.productName}}</td>
            <td width="100">房间号</td>
            <td width="160">{{printItem.itemName}}</td>
          </tr>
          <tr>
            <td width="100">报修时间</td>
            <td colspan="3">{{printItem.createTime|dateTransfer:'YYYY-MM-DD HH:mm'}}</td>
          </tr>
          <tr style="min-height: 120px;">
            <td style="height: 120px;">报修内容</td>
            <td colspan="3">{{printItem.content}}</td>
          </tr>
          <tr>
            <td width="100">维修时间</td>
            <td colspan="3">{{printItem.providerTime|dateTransfer:'YYYY-MM-DD HH:mm'}}</td>
          </tr>
          <tr>
            <td width="100">是否用户付费</td>
            <td width="160">{{printItem.needFee|constantTransfer:needFeeList}}</td>
            <td width="100">费用</td>
            <td width="160">{{printItem.repairFee}}</td>
          </tr>
          <tr style="min-height: 120px;">
            <td style="height: 120px;">备注</td>
            <td colspan="3">{{printItem.remark}}</td>
          </tr>
        </table>
      </div>
    </div>
  </div>

</div>
